package whf.framework.ext.dao;

import java.util.List;

import whf.framework.exception.FindException;
import whf.framework.ext.entity.Category;
import whf.framework.ext.entity.DictItem;

/**
 * @author wanghaifeng
 * @email king@126.com
 * @modify 2006-06-16
 */
public class DictItemDAOImp extends whf.framework.dao.DAOImp<DictItem> implements DictItemDAO {
	public List<DictItem> findByCategory(Category category) throws FindException{
		if(category == null){
			return super.query("order by t.category.name, t.code",0, Integer.MAX_VALUE);
		} else {
			return super.find("t.category=? order by t.code", new Object[]{category});
		}
	}
} 